//
//  CalloutCollectionCell.m
//  operation4ios
//
//  Created by kjlink on 16/8/31.
//  Copyright © 2016年 阳光电源股份有限公司. All rights reserved.
//

#import "CalloutCollectionCell.h"

@interface CalloutCollectionCell ()
//累计发电
@property (weak, nonatomic) IBOutlet UILabel *totalPowerTitle;
@property (weak, nonatomic) IBOutlet UILabel *totalPowerUnit;
@property (weak, nonatomic) IBOutlet UILabel *totalPower;
//今日发电
@property (weak, nonatomic) IBOutlet UILabel *todayPowerTitle;
@property (weak, nonatomic) IBOutlet UILabel *todayPowerUnit;
@property (weak, nonatomic) IBOutlet UILabel *todayPower;
//当前功率
@property (weak, nonatomic) IBOutlet UILabel *currentPowerTitle;
@property (weak, nonatomic) IBOutlet UILabel *currentPowerUnit;
@property (weak, nonatomic) IBOutlet UILabel *currentPower;
//装机功率
@property (weak, nonatomic) IBOutlet UILabel *installedPowerTitle;
@property (weak, nonatomic) IBOutlet UILabel *installedPowerUnit;
@property (weak, nonatomic) IBOutlet UILabel *installedPower;
//电站名称
@property (weak, nonatomic) IBOutlet UILabel *ps_title;
@property (weak, nonatomic) IBOutlet UILabel *countLabel;

@end

@implementation CalloutCollectionCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self localized];
}

//本地化
- (void)localized {
    self.todayPowerTitle.text = NSLocalizedString(@"今日发电", nil);
    self.totalPowerTitle.text = NSLocalizedString(@"累计发电", nil);
    self.currentPowerTitle.text = NSLocalizedString(@"当前功率", nil);
    self.installedPowerTitle.text = NSLocalizedString(@"装机容量", nil);
}

- (void)setMapPsModel:(MapPS *)mapPsModel {
    _mapPsModel = mapPsModel;
    self.ps_title.text = _mapPsModel.ps_name;
    self.totalPower.text = _mapPsModel.total_energy[@"value"];
    self.todayPower.text = _mapPsModel.today_energy[@"value"];
    self.currentPower.text = _mapPsModel.curr_power[@"value"];
    self.installedPower.text = _mapPsModel.total_capcity[@"value"];
    
    self.totalPowerUnit.text = _mapPsModel.total_energy[@"unit"];
    self.todayPowerUnit.text = _mapPsModel.today_energy[@"unit"];
    self.currentPowerUnit.text = _mapPsModel.curr_power[@"unit"];
    self.installedPowerUnit.text = _mapPsModel.total_capcity[@"unit"];
    
    self.countLabel.text = [NSString stringWithFormat:@"%zd/%zd",_index + 1,_totalCount];

}

@end
